﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sofire.DataComm.Remoting
{
    /// <summary>
    /// 表示客户端的凭证。
    /// </summary>
    public class RemotingCertificate
    {
        private string _Address;
        /// <summary>
        /// 获取客户端的地址信息（短）。
        /// </summary>
        public string Address
        {
            get
            {
                return this._Address;
            }
        }

        private string _ContractName;
        /// <summary>
        /// 获取客户端的契约信息。
        /// </summary>
        public string ContractName
        {
            get
            {
                return this._ContractName;
            }
        }

        private string _Username;
        /// <summary>
        /// 获取客户端的用户信息。
        /// </summary>
        public string Username
        {
            get
            {
                return this._Username;
            }
        }

        private string _Password;
        /// <summary>
        /// 获取客户端的密码信息。
        /// </summary>
        public string Password
        {
            get
            {
                return this._Password;
            }
        }

        private string _SessionID;
        /// <summary>
        /// 获取服务端的会话编号。
        /// </summary>
        public string SessionID
        {
            get
            {
                return this._SessionID;
            }
        }

        private RemotingCertificate() { }

        /// <summary>
        /// 初始化 <see cref="Sofire.DataComm.Remoting.RemotingCertificate"/> 的新实例。
        /// </summary>
        /// <param name="address">客户端的地址信息。</param>
        /// <param name="username">客户端的用户信息。</param>
        /// <param name="password">客户端的密码信息。</param>
        /// <param name="contractName">客户端的契约信息。</param>
        /// <param name="sessionID">服务端的会话编号。</param>
        public RemotingCertificate(string address, string contractName, string username, string password,string sessionID)
        {
            this._Address = address;
            this._ContractName = contractName;
            this._Username = username;
            this._Password = password;
            this._SessionID = sessionID;
        }

    }
}
